/**
* 版权声明：厦门睿商网络科技有限公司 版权所有 违者必究
* 日    期：2020-02-17
*/
package com.rzico.basics.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.rzico.core.entity.SysUser;
import lombok.Data;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;

/**
 * <pre>
 *   收货地址数据库对象
 * </pre>
 * @author Rzico Boot
 * @version 1.0
 */
@Data
@Table(name = "wx_receiver")
@JsonIgnoreProperties(value = {"handler"})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Receiver {

    @Id
    @ApiModelProperty(value = "")
    protected Long id;

    @ApiModelProperty(value = "创建日期")
    protected java.util.Date createDate;

    @ApiModelProperty(value = "修改日期")
    protected java.util.Date modifyDate;

    @ApiModelProperty(value = "地址")
    protected String address;

    @ApiModelProperty(value = "地区名称")
    protected String areaName;

    @ApiModelProperty(value = "小区/大楼")
    protected String building;

    @ApiModelProperty(value = "门牌号")
    protected String roomNumber;

    @ApiModelProperty(value = "收货人")
    protected String consignee;

    @ApiModelProperty(value = "是否默认")
    protected Boolean isDefault;

    @ApiModelProperty(value = "电话")
    protected String phone;

    @ApiModelProperty(value = "地区")
    protected Integer areaId;

    @ApiModelProperty(value = "会员")
    protected Long memberId;

    @ApiModelProperty(value = "伟度")
    protected Double lat;

    @ApiModelProperty(value = "经度")
    protected Double lng;

    @ApiModelProperty(value = "楼层")
    protected Integer level;

    @ApiModelProperty(value = "地区")
    protected Long mapLineId;

    @ApiModelProperty(value = "地区")
    protected MapLine mapLine;

    @ApiModelProperty(value = "地区")
    protected Member member;

    public String getMapLineName() {
        MapLine mapLine = getMapLine();
        if (mapLine!=null) {
            return mapLine.getName();
        } else {
            return null;
        }
    }


    public String getMemberName() {
        Member member = getMember();
        if (member!=null) {
            return member.getName();
        }
        return "";
    }

    public String getMemberMobile() {
        Member member = getMember();
        if (member!=null) {
            return member.getMobile();
        }
        return "";
    }


}
